<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI助手 - 对话与翻译</title>
    <link rel="stylesheet" href="css/styles.css">
</head>
<body>
    <div class="container">
        <header>
            <h1>AI助手</h1>
            <p>对话与中英翻译工具</p>
        </header>
        
        <main>
            <!-- 功能切换 -->
            <div class="function-selector">
                <button id="chat-btn" class="active">对话模式</button>
                <button id="translate-btn">翻译模式</button>
            </div>
            
            <!-- 翻译模式界面 -->
            <div id="translate-panel" class="panel hidden">
                <div class="translation-header">
                    <span id="translation-direction">中文 → 英文</span>
                    <button id="swap-lang-btn" title="交换语言"><i class="swap-icon">&lt;=&gt;</i></button>
                </div>
                <div id="translation-history" class="chat-history"></div>
                <div class="chat-input-container">
                    <textarea id="source-text" placeholder="请输入要翻译的文本..."></textarea>
                    <button id="translate-submit-btn" class="submit-btn">翻译</button>
                </div>
            </div>
            
            <!-- 对话模式界面 -->
            <div id="chat-panel" class="panel">
                <div id="chat-history" class="chat-history"></div>
                <div class="chat-input-container">
                    <textarea id="chat-input" placeholder="请输入您的问题..."></textarea>
                    <button id="chat-submit-btn" class="submit-btn">发送</button>
                </div>
            </div>
            
            <!-- 加载提示 -->
            <div id="loading" class="loading hidden">
                <div class="loading-spinner"></div>
                <p>AI正在思考...</p>
            </div>
        </main>
    </div>
    
    <script src="js/app.js"></script>
</body>
</html>